<?php
namespace api\app\controller;

use api\app\model\SortModel;
use api\app\validate\Vildate;
use cmf\controller\RestBaseController;


class SortController extends RestBaseController
{
    public function index()
    {
        $list = SortModel::select();
        return success('分类显示', $list);
    }


    public function getSortInfo()
    {
        $data = input('post.');
        $id = $data['id'];
        if (empty($id)) {
            return error('参数错误');
        }
        $news = SortModel::find($id);
        if (!$news) {
            return error('类不存在');
        }
        return success('返回成功', $news);
    }
}